package sys_auth

import (
	"time"

	"github.com/beego/beego/v2/client/orm"
)

type SysAuth struct {
	AuthId     int       `orm:"column(auth_id);pk" gorm:"primaryKey"`
	ParentId   int       `description:"父级权限ID"`
	Name       string    `description:"权限名称或者按钮名称"`
	AuthType   int       `description:"权限类型： 0-菜单; 1-按钮"`
	CreateTime time.Time `description:"创建时间"`
	ModifyTime time.Time `description:"更新时间"`
	Api        string    `description:"按钮相关api"`
}

func (s *SysAuth) Create(*SysAuth) (err error) {
	db := orm.NewOrm()
	_, err = db.Insert(s)
	return
}
